package com.yxtbd.travel.travelvm.model.bean

/**
 * @Description 登录返回实体
 *
 * @author taodq
 * @Date 2019-08-12.
 */
sealed class ApiBaseResult<out T : Any> {

    data class Success<out T : Any>(val data: T) : ApiBaseResult<T>()
    data class Error(val exception: Exception) : ApiBaseResult<Nothing>()

    override fun toString(): String {
        return when (this) {
            is Success<*> -> "Success[data=$data]"
            is Error -> "Error[exception=$exception]"
        }
    }
}